return !active_console->text_console;
}
+void set_color_table(DisplayState *ds)
+{
+ int i, j;
+ for(j = 0; j < 2; j++) {
+ for(i = 0; i < 8; i++) {
+ color_table[j][i] =
+ col_expand(ds, vga_get_color(ds, color_table_rgb[j][i]));
+ }
+ }
+}
+
CharDriverState *text_console_init(DisplayState *ds)
{
CharDriverState *chr;
TextConsole *s;
- int i,j;
static int color_inited;
chr = qemu_mallocz(sizeof(CharDriverState));
if (!color_inited) {
color_inited = 1;
- for(j = 0; j < 2; j++) {
- for(i = 0; i < 8; i++) {
- color_table[j][i] = col_expand(s->ds,
- vga_get_color(s->ds, color_table_rgb[j][i]));
- }
- }
+ set_color_table(ds);
}
s->y_displayed = 0;
s->y_base = 0;
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c 2006-07-26 13:39:18.439320475 +0100
-+++ ioemu/vl.c 2006-07-26 13:39:18.499314057 +0100
++++ ioemu/vl.c 2006-07-26 14:13:44.488196651 +0100
@@ -6003,8 +6003,10 @@
kernel_filename, kernel_cmdline, initrd_filename,
timeoffset);
Index: ioemu/vnc.c
===================================================================
--- ioemu.orig/vnc.c 2006-07-26 13:39:18.437320689 +0100
-+++ ioemu/vnc.c 2006-07-26 13:39:18.500313950 +0100
++++ ioemu/vnc.c 2006-07-26 14:16:51.636538318 +0100
@@ -3,6 +3,7 @@
*
* Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
}
static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
-@@ -109,11 +142,15 @@
+@@ -109,16 +142,23 @@
static void vnc_dpy_resize(DisplayState *ds, int w, int h)
{
VncState *vs = ds->opaque;
fprintf(stderr, "vnc: memory allocation failed\n");
exit(1);
}
-@@ -131,6 +168,10 @@
+
+- ds->depth = vs->depth * 8;
++ if (ds->depth != vs->depth * 8) {
++ ds->depth = vs->depth * 8;
++ set_color_table(ds);
++ }
+ ds->width = w;
+ ds->height = h;
+ ds->linesize = w * vs->depth;
+@@ -131,6 +171,10 @@
vs->width = ds->width;
vs->height = ds->height;
}
}
static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h)
-@@ -215,8 +256,20 @@
+@@ -215,8 +259,20 @@
int y = 0;
int pitch = ds->linesize;
VncState *vs = ds->opaque;
if (dst_y > src_y) {
y = h - 1;
-@@ -238,31 +291,34 @@
+@@ -238,31 +294,34 @@
old_row += pitch;
}
{
VncState *vs = opaque;
int64_t now = qemu_get_clock(rt_clock);
-@@ -274,11 +330,12 @@
+@@ -274,11 +333,12 @@
uint64_t width_mask;
int n_rectangles;
int saved_offset;
- int has_dirty = 0;
+-
+- width_mask = (1ULL << (vs->width / 16)) - 1;
+ int maxx, maxy;
+ int tile_bytes = vs->depth * DP2X(vs, 1);
-- width_mask = (1ULL << (vs->width / 16)) - 1;
--
- if (vs->width == 1024)
+ if (vs->width != DP2X(vs, DIRTY_PIXEL_BITS))
+ width_mask = (1ULL << X2DP_UP(vs, vs->ds->width)) - 1;
width_mask = ~(0ULL);
/* Walk through the dirty map and eliminate tiles that
-@@ -294,16 +351,18 @@
+@@ -294,16 +354,18 @@
ptr = row;
old_ptr = old_row;
}
}
-@@ -311,7 +370,8 @@
+@@ -311,7 +373,8 @@
old_row += vs->ds->linesize;
}
goto out;
/* Count rectangles */
-@@ -321,40 +381,61 @@
+@@ -321,40 +384,61 @@
saved_offset = vs->output.offset;
vnc_write_u16(vs, 0);
static void vnc_timer_init(VncState *vs)
{
if (vs->timer == NULL) {
-@@ -365,8 +446,6 @@
+@@ -365,8 +449,6 @@
static void vnc_dpy_refresh(DisplayState *ds)
{
vga_hw_update();
}
-@@ -402,7 +481,7 @@
+@@ -402,7 +484,7 @@
static void buffer_reset(Buffer *buffer)
{
}
static void buffer_append(Buffer *buffer, const void *data, size_t len)
-@@ -443,12 +522,12 @@
+@@ -443,12 +525,12 @@
if (!ret)
return;
}
static void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting)
-@@ -480,11 +559,11 @@
+@@ -480,11 +562,11 @@
return;
if (!ret) {
}
}
-@@ -492,9 +571,9 @@
+@@ -492,9 +574,9 @@
{
buffer_reserve(&vs->output, len);
buffer_append(&vs->output, data, len);
}
-@@ -616,24 +695,25 @@
+@@ -616,24 +698,25 @@
do_key_event(vs, down, sym);
}
}
static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
-@@ -690,8 +770,6 @@
+@@ -690,8 +773,6 @@
vnc_client_error(vs);
vnc_dpy_resize(vs->ds, vs->ds->width, vs->ds->height);
vga_hw_invalidate();
vga_hw_update();
-@@ -848,11 +926,11 @@
+@@ -848,11 +929,11 @@
vnc_write(vs, "RFB 003.003\n", 12);
vnc_flush(vs);
vnc_read_when(vs, protocol_version, 12);
}
}
-@@ -909,17 +987,15 @@
+@@ -909,17 +990,15 @@
exit(1);
}
Index: ioemu/vnc.c
===================================================================
---- ioemu.orig/vnc.c 2006-07-26 13:39:18.500313950 +0100
-+++ ioemu/vnc.c 2006-07-26 13:39:18.648298117 +0100
-@@ -999,3 +999,25 @@
+--- ioemu.orig/vnc.c 2006-07-26 14:16:51.636538318 +0100
++++ ioemu/vnc.c 2006-07-26 14:18:15.612266329 +0100
+@@ -1002,3 +1002,25 @@
vnc_dpy_resize(vs->ds, 640, 400);
}
+}
Index: ioemu/vl.c
===================================================================
---- ioemu.orig/vl.c 2006-07-26 13:39:18.499314057 +0100
-+++ ioemu/vl.c 2006-07-26 13:39:18.650297903 +0100
+--- ioemu.orig/vl.c 2006-07-26 14:13:44.488196651 +0100
++++ ioemu/vl.c 2006-07-26 14:18:15.615265998 +0100
@@ -121,6 +121,7 @@
int bios_size;
static DisplayState display_state;
sdl_display_init(ds, full_screen);
Index: ioemu/vl.h
===================================================================
---- ioemu.orig/vl.h 2006-07-26 13:39:18.030364229 +0100
-+++ ioemu/vl.h 2006-07-26 13:39:18.651297796 +0100
-@@ -732,6 +732,7 @@
+--- ioemu.orig/vl.h 2006-07-26 14:18:05.490383989 +0100
++++ ioemu/vl.h 2006-07-26 14:18:15.616265887 +0100
+@@ -733,6 +733,7 @@
/* vnc.c */
void vnc_display_init(DisplayState *ds, int display);